<?php
namespace app\admin\controller;

use think\facade\Db;
use think\facade\Request;
use app\admin\model\Admin as AdminModel;

class Admin extends Base
{
   public function index(){
       if(Request::instance()->isAjax()){
           $param = input('param.');
           $limit = $param['pageSize'];
           $offset = ($param['pageNumber'] - 1) * $limit;
           $where=[];
           $admin=new AdminModel();
           $selectResult=$admin->getAdminsByWhere($where,$offset,$limit);
           $return=[];
           $return['total']=$admin->getAllAdmins($where);
           $return['rows']=$selectResult;
           return json($return);
       }
       return view('index');
   }
}
